﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraTreeList;

namespace QLTV.Forms.KhaiBao
{
    public partial class frmShortPlan : DevExpress.XtraEditors.XtraForm
    {
        public frmShortPlan()
        {
            InitializeComponent();
        }

        private void frmShortPlan_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dsShortPlan.tblVessel' table. You can move, or remove it, as needed.
            //this.tblVesselTableAdapter.Fill(this.dsShortPlan.tblVessel);
            // TODO: This line of code loads data into the 'dsShortPlan.tblVesselGroup' table. You can move, or remove it, as needed.
            this.tblVesselGroupTableAdapter.Fill(this.dsShortPlan.tblVesselGroup);

        }

        private void treeList1_MouseClick(object sender, MouseEventArgs e)
        {
            TreeListHitInfo info = treeList1.CalcHitInfo(e.Location);
            if (info.Node != null)
            {
                this.tblVesselTableAdapter.FillByGroup(dsShortPlan.tblVessel, int.Parse(info.Node.GetValue(colnGroupId).ToString()));
            }
        }

        private void gridControl1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            frmShortPlanDetails f = new frmShortPlanDetails(gridView1.GetFocusedRowCellDisplayText(colcVesselName));
            f.Show();
        }
    }
}